package com.gzx.plugin.data.wxjk.sync.dao;

import com.gzx.plugin.data.wxjk.sync.pojo.SssjCleanLoanInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CleanLoanInfoDao {
    @Insert("<script>" +
            "INSERT INTO data_wxjk_sssjCleanLoanInfo(" +
            "    business_id, " +
            "    bill_month, " +
            "    clean_loan_principal, " +
            "    clean_loan_inst, " +
            "    clean_loan_penalty, " +
            "    clean_loan_other, " +
            "    create_time, " +
            "    update_time" +
            ") VALUES " +
            "<foreach collection='list' item='cleanLoanInfo' separator=','>" +
            "    (" +
            "        #{cleanLoanInfo.businessId}, " +
            "        #{cleanLoanInfo.billMonth}, " +
            "        #{cleanLoanInfo.cleanLoanPrincipal}, " +
            "        #{cleanLoanInfo.cleanLoanInst}, " +
            "        #{cleanLoanInfo.cleanLoanPenalty}, " +
            "        #{cleanLoanInfo.cleanLoanOther}, " +
            "        now(), " +
            "        now()" +
            "    )" +
            "</foreach>" +
            "</script>")
    void batchSave(@Param("list") List<SssjCleanLoanInfo> list);
}
